package com.pointmi.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseStatus;

import com.pointmi.loyaltydao.Loyalty;
import com.pointmi.loyaltyservice.LoyaltyService;

@Controller
@RequestMapping("/pointmi-api/loyalty")
public class LoyaltyController {
	
	@Autowired
	@Qualifier("loyaltyService")
	private LoyaltyService loyaltyService;
	
	
	@RequestMapping(method = RequestMethod.POST)
	@ResponseStatus( HttpStatus.CREATED )
	public void save(@RequestBody Loyalty newLoyalty)
	{
	  loyaltyService.saveOrUpdate(newLoyalty);
	}
	
	
	
	
	

}
